<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use Illuminate\Support\Facades\URL;
// 登录页面
Route::get('/', 'Backend\LoginController@login')->name('/');
//// 生成验证码
//Route::get('/backend/captcha/create', 'Backend\CliCaptchaController@create');
//// 验证二维码验证码
//Route::post('/backend/captcha/check', 'Backend\CliCaptchaController@check');

// 验证码模块
Route::group(['prefix' => '/backend/captcha/'], function () {
    // 生成验证码
    Route::get('create', 'Backend\CliCaptchaController@create');
    // 验证二维码验证码
    Route::post('check', 'Backend\CliCaptchaController@check');
});

// 注册模块
Route::group(['prefix' => '/backend/login/'], function () {
    // 注册页面
    Route::get('register', 'Backend\LoginController@register');
    // 忘记密码
    Route::get('forget', 'Backend\LoginController@forget');
    // 发送邮箱验证码
    Route::post('postemail', 'Backend\LoginController@postEmail');
    // 注册账号
    Route::post('registerpost', 'Backend\LoginController@registerPost');
    // 登入账号
    Route::post('loginpost', 'Backend\LoginController@loginPost');
    // 忘记密码操作
    Route::post('forgetpost', 'Backend\LoginController@forgetPost');
    // 登出
    Route::any('logoutpost', 'Backend\LoginController@logoutPost');
});

// 首页模块
Route::group(['prefix' => '/backend/index/'], function () {
    // 首页页面
    Route::get('index', 'Backend\IndexController@index');
});

// 京东模块
Route::group(['prefix' => '/backend/jd/'], function () {
    // 精选页面渲染
    Route::get('jingxuan', 'Backend\JdController@jingxuan');
    // 精选页面数据请求
    Route::post('jingxuanpost', 'Backend\JdController@jingXuanPost');

    // 类别页面渲染
    Route::get('category', 'Backend\JdController@category');
    // 类别页面列表
    Route::post('categorylistpost', 'Backend\JdController@categoryListPost');

    // 转链
    Route::any('promotionpost', 'Backend\JdController@promotionPost');

    // 同步类别
    Route::post('synccategorypost', 'Backend\JdController@syncCategoryPost');
    // 同步类别
    Route::post('syncjingxuanpost', 'Backend\JdController@syncJingxuanPost');
});

// 苏宁模块
Route::group(['prefix' => '/backend/suning/'], function () {
    // 类别页面渲染
    Route::get('category', 'Backend\SnController@category');
    // 类别页面列表
    Route::post('categorylistpost', 'Backend\SnController@categoryListPost');
    // 同步类别
    Route::post('synccategorypost', 'Backend\SuningController@syncCategoryPost');
    // 获取类目请求
    Route::any('test', 'Backend\SuningController@test');
});

// 公司模块
Route::group(['prefix' => '/backend/group/'], function () {
    // 公司编辑页面
    Route::get('edit', 'Backend\GroupController@edit');
    // 公司成员页面
    Route::get('members', 'Backend\GroupController@members');
    // 申请加入公司页面
    Route::get('apply', 'Backend\GroupController@apply');
    // 审核列表
    Route::get('examine', 'Backend\GroupController@examine');

    Route::post('getgrouppost', 'Backend\GroupController@getGroupPost');
    Route::post('setgrouppost', 'Backend\GroupController@setGroupPost');
    Route::post('listmemberspost', 'Backend\GroupController@listMembersPost');
    Route::post('listgrouppost', 'Backend\GroupController@listGroupPost');
    Route::post('addapply', 'Backend\GroupController@addApply');
    Route::post('delapply', 'Backend\GroupController@delApply');
    Route::post('listapply', 'Backend\GroupController@listApply');
    Route::post('examineapply', 'Backend\GroupController@examineApply');
});

// 权限模块
Route::group(['prefix' => '/backend/role/'], function () {
    // 角色列表
    Route::get('listrole', 'Backend\RoleController@listRole');
    // 权限列表
    Route::get('listauthority', 'Backend\RoleController@listAuthority');
    // 列表角色
    Route::post('listrolepost', 'Backend\RoleController@listRolePost');
    // 添加角色
    Route::post('addrolepost', 'Backend\RoleController@addRolePost');
});

